import cv2
import numpy as np

# sift，尺度不变特征变换
img = cv2.imread("C:\\Users\\86191\\Pictures\\Saved Pictures\\Camera Roll\\shudu.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# 创建sift对象
sift = cv2.xfeatures2d.SIFT_create()
# 检测关键点
kp = sift.detect(gray,None)
# 绘制关键点
cv2.drawKeypoints(gray,kp,img,(255,0,0))
cv2.imshow("img",img)
cv2.waitKey(0)